import React from 'react';
import PropTypes from 'prop-types';
import {Button} from "antd";

const PageActionBar = props => {
    const {btnList, inline} = props;
    return (
        <div className="page-action-bar" style={{display: inline ? 'inline-block' : 'block'}}>
            {btnList.map(btn=> {
                return (
                    <Button type={btn.type || 'default'} icon={btn.icon||null} onClick={btn.onClick}>
                        {btn.name}
                    </Button>
                )
            })}
        </div>
    );
};

PageActionBar.propTypes = {
    btnList: PropTypes.array.isRequired,
};

export default PageActionBar;